package k_singleton.a_design_pattern.c_double_checked_locking;


/**
 * Created by wug on 2016/7/15 0015.
 */
public class MainTest {
    public static void main(String[] args) {
        new MainTest().run();
    }

    public void run() {
        Runnable task = new Task();
        for (int i = 0; i < 10; i++) {
            Thread t = new Thread(task, String.valueOf(i));
            t.start();
        }

    }

    public class Task implements Runnable {
        @Override
        public void run() {
            Singleton instance = Singleton.getInstance();
            System.out.println(instance + ":" + instance.hashCode());
        }
    }



}
